<!DOCTYPE html>
<html>
	<head>
			<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>新闻列表</title>
		<script src="../js/mui.min.js"></script>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/style1.css" />
		<link rel="stylesheet" href="../css/member.css" />
		<link rel="stylesheet" href="../css/picker.css" />
		<link rel="stylesheet" href="../css/poppicker.css" />
		<link rel="stylesheet" type="text/css" href="../css/datepicker3.css" />
		<script src="../plugin/crop/croppie.min.js"></script>
		<link rel="stylesheet" href="../css/font-awesome.min.css" />
		<link rel="stylesheet" href="../css/bootstrap.min.css" />

		<style type="text/css">
			.grzl_toux {
				position: relative;
			}
			/*#upload{opacity:0;filter:alpha(opacity=0);height: 95px; width: 100px;position: absolute;top: -80px;left: -40px;z-index: 9;}*/
			/*.btn_thumb{opacity:0;filter:alpha(opacity=0);height: 95px; width: 100px;position: absolute;top: -0px;left: -0px;z-index: 9;}*/
		</style>
	</head>
	<body>
		<div style="height: 45px;">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">新闻列表</h1>
		</header>
		</div>
		<div class="classily" style="display:inline;" >		
		</div>
		<div class="mui-content">		
		</div>
		<div class="select">			
		</div>
		<div id="footer"></div>
		<div id="allmap"></div>
	</body>
	
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
<script src="../js/layer/layer.min.js"></script>
<script src="../js/castapp.js"></script>
<script src="../js/app.js"></script>
<script src="../js/picker.js"></script>
<script src="../js/poppicker.js"></script>
<script src="../js/city.data-3.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
getFoot(getUrlParam("foot_active") > 0 ? getUrlParam("foot_active") : 1);
var mem_id =getUrlParam('id');
	$(function() {
	$.ajax({
			//请求的url
			//注意，如果我们使用路由器的情况下，我们需要设置一下本地服务器的ip地址
			url: APP.api_url + 'News/new_list',
			data: {
				id:mem_id
			},
		   dataType:'JSONP',  // 处理Ajax跨域问题
		//成功了的回调，并且带有返回值
		success: function(data) {
				if(data.code == 200) {
				var mem_list = data.list;
				var z_list =data.z_list;
				var mem_htm = "";
				var class_htm='';
				  for(var i = 0; i < z_list.length; i++) {			
				  			 class_htm += '<span  style="color:red;width:16.6%;" onclick=select(' +z_list[i].id +')	class="mui-btn">' + z_list[i].typename + '</span>';				  			 				
						    $(".classily").html(class_htm);
						 }
			  	 for(var i = 0; i < mem_list.length; i++) {			
						if(i <= 6) {																			
							mem_htm += '<div><ul class="mui-table-view">' +
								'<li class="mui-table-view-cell mui-media">' +
								"<a onclick=quer_mem(" + mem_list[i].id + ")>" +
								"<img class='mui-media-object mui-pull-left' src=" + APP.pic_url + mem_list[i].images + ">" +
								'<div class="mui-media-body">' +
								'<span style="float:left;">' + mem_list[i].title + '</span>' +
								'</div>' +
								'<span style="float:left;">' + mem_list[i].author + '</span><span style="float:right;">' + mem_list[i].add_time + '</span></a>' +
								'</ul></div>';
				     $(".mui-content ").html(mem_htm);
			}else {
					console.log('data.msg');
					}
				}
			}
		  }
		});
	});
	//跳转
	function quer_mem(id) {
		var member = JSON.parse(localStorage.getItem("member"));
		if(!member) {
			layer.msg('请登录', { icon: 2, time: 1500, shade: 0.1 });
			window.location.href = "login.html";
		} else {
			window.location.href = "xq.html?id=" + id;
		}

	}
	//获取被选择的方法
	function select(id){
		$.ajax({
			//请求的url
			//注意，如果我们使用路由器的情况下，我们需要设置一下本地服务器的ip地址
			url: APP.api_url + 'News/select',
			data: {
				id:id
			},
		   dataType:'JSONP',  // 处理Ajax跨域问题
		//成功了的回调，并且带有返回值
		success: function(data) {
				if(data.code == 200) {
				var mem_list = data.list;
				if(mem_list != ''){
					var mem_htm = "";				 
			  		 for(var i = 0; i < mem_list.length; i++) {			
						if(i <= 6) {																			
							mem_htm += '<div><ul class="mui-table-view">' +
								'<li class="mui-table-view-cell mui-media">' +
								"<a onclick=quer_mem(" + mem_list[i].id + ")>" +
								"<img class='mui-media-object mui-pull-left' src=" + APP.pic_url + mem_list[i].images + ">" +
								'<div class="mui-media-body">' +
								'<span style="float:left;">' + mem_list[i].title + '</span>' +
								'</div>' +
								'<span style="float:left;">' + mem_list[i].author + '</span><span style="float:right;">' + mem_list[i].add_time + '</span></a>' +
								'</ul></div>';				    	 
				    	 $(".select").html(mem_htm);
				}else{
					
					}
				}
			}else {
					layer.msg('暂时没有该商品的相关信息');
					}
				}
			  	 $(".mui-content").hide();
			  
			}
		  
		});
	}

</script>
</html>
